﻿//<TunynetCopyright>
//--------------------------------------------------------------
//<copyright>青岛拓宇网络科技有限公司 2005-2008</copyright>
//<version>V0.5</verion>
//<createdate>2008-2-22</createdate>
//<author>mazq</author>
//<email>mazq@tunynet.com</email>
//<log date="2008-2-22">创建</log>
//--------------------------------------------------------------
//</TunynetCopyright>

using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;
using ChinaCustoms.Framework.DeluxeWorks.Library.Data;

namespace ChinaCustoms.Qingdao.Workflow.Supports
{
    public class SqlHelper
    {
        //public static readonly string WorkflowConnectionString = DbContext.GetContext(DatabaseFactory.Create("WorkflowConnectionString").Name).Connection.ConnectionString;//ConfigurationManager.ConnectionStrings["WorkflowConnectionString"].ConnectionString;

        public static SqlConnection WorkflowConnection
        {
            get
            {
                Database database = DatabaseFactory.Create("WorkflowConnectionString");
                DbContext context = DbContext.GetContext(database.Name,false);
                SqlConnection conn= context.Connection as SqlConnection;
                //conn.Close();
                return conn;
            }
        }

        //public static Database GetDataBase()
        //{
        //    Database database = DatabaseFactory.Create("WorkflowConnectionString");
        //    return database;
        //    //database.CreateStoredProcedureCommand();
        //}
    }
}
